ITSTGCN add Model

ITSTGCN
Author

SEOYEON CHOI

Published

May 31, 2099

summerizing it

RANDOM

import itstgcnEvolveGCNH
import torch
import itstgcnEvolveGCNH.planner 
import pandas as pd

import numpy as np
import random
data_dict = itstgcnGCLSTM.load_data('./data/fivenodes.pkl')
loader = itstgcnGConvLSTM.DatasetLoader(data_dict)
from torch_geometric_temporal.dataset import ChickenpoxDatasetLoader
loader1 = ChickenpoxDatasetLoader()
from torch_geometric_temporal.dataset import PedalMeDatasetLoader
loader2 = PedalMeDatasetLoader()
from torch_geometric_temporal.dataset import WikiMathsDatasetLoader
loader3 = WikiMathsDatasetLoader()
# from torch_geometric_temporal.dataset import WindmillOutputLargeDatasetLoader
# loader4 = WindmillOutputLargeDatasetLoader()
# from torch_geometric_temporal.dataset import WindmillOutputMediumDatasetLoader
# loader5 = WindmillOutputMediumDatasetLoader()
# from torch_geometric_temporal.dataset import WindmillOutputSmallDatasetLoader
# loader6 = WindmillOutputSmallDatasetLoader()
loader6 = itstgcnEvolveGCNH.load_data('./data/Windmillsmall.pkl')
# dataset6 = _a.get_dataset(lags=8)
from torch_geometric_temporal.dataset import MontevideoBusDatasetLoader
loader10 = MontevideoBusDatasetLoader()

Simulation

plans_stgcn_rand = {
    'max_iteration': 1, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0.7],
    'lags': [8], 
    'nof_filters': [12], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader6,dataset_name='windmillsmall')
plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mrate': [0.7],
    'lags': [2], 
    'nof_filters': [12], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader,dataset_name='fivenodes')

plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mrate': [0.8],
    'lags': [2], 
    'nof_filters': [12], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader,dataset_name='fivenodes')

plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mrate': [0],
    'lags': [2], 
    'nof_filters': [12], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader,dataset_name='fivenodes')

plnr.simulate()
mindex= [[],[],[],list(range(50,150)),[]]
# mindex= [list(range(50,150)),[],list(range(50,90)),list(range(50,150)),[]] # node 2
plans_stgcn_block = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mindex': [mindex],
    'lags': [2], 
    'nof_filters': [12], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader,dataset_name='fivenodes')

plnr.simulate(mindex=mindex,mtype='block')
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0.3,0.8],
    'lags': [4], 
    'nof_filters': [32], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader1,dataset_name='chickenpox')
plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0],
    'lags': [4], 
    'nof_filters': [32], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader1,dataset_name='chickenpox')
plnr.simulate()
my_list = [[] for _ in range(20)] #chickenpox
another_list = list(range(100,400))
my_list[1] = another_list
my_list[3] = another_list
my_list[5] = another_list
my_list[7] = another_list
my_list[9] = another_list
my_list[11] = another_list
my_list[13] = another_list
my_list[15] = another_list
mindex = my_list
# mindex= [[],[],[],list(range(50,150)),[]]
# mindex= [list(range(50,150)),[],list(range(50,90)),list(range(50,150)),[]] # node 2
plans_stgcn_block = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mindex': [mindex],
    'lags': [4], 
    'nof_filters': [32], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader1,dataset_name='chickenpox')

plnr.simulate(mindex=mindex,mtype='block')
plans_stgcn_rand = {
    'max_iteration': 30, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0,0.3,0.6],
    'lags': [4], 
    'nof_filters': [2], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader2,dataset_name='pedalme')

plnr.simulate()
my_list = [[] for _ in range(15)] #pedalme
another_list = list(range(5,25))
my_list[1] = another_list
my_list[3] = another_list
my_list[5] = another_list
my_list[7] = another_list
my_list[9] = another_list
my_list[11] = another_list
mindex = my_list
# mindex= [[],[],[],list(range(50,150)),[]]  # node 1
# mindex= [list(range(10,100)),[],list(range(50,80)),[],[]] # node 2
# mindex= [list(range(10,100)),[],list(range(50,80)),list(range(50,150)),[]] # node3
plans_stgcn_block = {
    'max_iteration': 30, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mindex': [mindex],
    'lags': [4], 
    'nof_filters': [2], 
    'inter_method': ['linear','nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader2,dataset_name='pedalme')
plnr.simulate(mindex=mindex,mtype='block')
plans_stgcn_rand = {
    'max_iteration': 10, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0.3],
    'lags': [8], 
    'nof_filters': [12], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader3,dataset_name='wikimath')
plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0.8],
    'lags': [8], 
    'nof_filters': [12], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader3,dataset_name='wikimath')
plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 10, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0],
    'lags': [8], 
    'nof_filters': [12], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnEvolveGCNH.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader3,dataset_name='wikimath')
plnr.simulate()
import random
my_list = [[] for _ in range(1068)] # wikimath
another_list = random.sample(range(570), 72)
# my_list에서 250개 요소 무작위 선택
selected_indexes = random.sample(range(len(my_list)), 250)
# 선택된 요소에 해당하는 값들을 another_list에 할당
for index in selected_indexes:
    my_list[index] = another_list
import random
my_list = [[] for _ in range(1068)] # wikimath
another_list = random.sample(range(570), 150)
# my_list에서 250개 요소 무작위 선택
selected_indexes = random.sample(range(len(my_list)), 500)
# 선택된 요소에 해당하는 값들을 another_list에 할당
for index in selected_indexes:
    my_list[index] = another_list
mindex = my_list
# mindex= [[],[],[],list(range(50,150)),[]]  # node 1
# mindex= [list(range(10,100)),[],list(range(50,80)),[],[]] # node 2
# mindex= [list(range(10,100)),[],list(range(50,80)),list(range(50,150)),[]] # node3
plans_stgcn_block = {
    'max_iteration': 10, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mindex': [mindex],
    'lags': [8], 
    'nof_filters': [12], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnEvolveGCNH.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader3,dataset_name='wikimath')
plnr.simulate(mindex=mindex,mtype='block')

같은 노드 같은 missing

my_list = [[] for _ in range(1068)] #wikimath
another_list = random.sample(range(0, 576), 300)
for i in range(0, 1068):
    my_list[i] = another_list
mindex = my_list
plans_stgcn_block = {
    'max_iteration': 10, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mindex': [mindex],
    'lags': [8], 
    'nof_filters': [12], 
    'inter_method': ['linear'],
    'epoch': [50]
}
plnr = itstgcnEvolveGCNH.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader3,dataset_name='wikimath')
plnr.simulate(mindex=mindex,mtype='block')
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0.8],
    'lags': [4], 
    'nof_filters': [12], 
    'inter_method': ['nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader10,dataset_name='monte')
plnr.simulate()
plans_stgcn_rand = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'],
    'mrate': [0],
    'lags': [4], 
    'nof_filters': [12], 
    'inter_method': ['nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_RAND(plans_stgcn_rand,loader10,dataset_name='monte')
plnr.simulate()
my_list = [[] for _ in range(675)] #monte
another_list = list(range(200,350)) #743

for i in np.array(random.sample(range(0, 675), 400)):
    my_list[i] = another_list
mindex = my_list
# mindex= [[],[],[],list(range(50,150)),[]]  # node 1
# mindex= [list(range(10,100)),[],list(range(50,80)),[],[]] # node 2
# mindex= [list(range(10,100)),[],list(range(50,80)),list(range(50,150)),[]] # node3
plans_stgcn_block = {
    'max_iteration': 15, 
    'method': ['STGCN', 'IT-STGCN'], 
    'mindex': [mindex],
    'lags': [4], 
    'nof_filters': [12], 
    'inter_method': ['nearest'],
    'epoch': [50]
}
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader10,dataset_name='monte')
plnr.simulate(mindex=mindex,mtype='block')
plnr = itstgcnGConvLSTM.planner.PLNR_STGCN_MANUAL(plans_stgcn_block,loader10,dataset_name='monte')
plnr.simulate(mindex=mindex,mtype='block')